package com.hanlink.dsp.util;

import android.widget.Toast;

import androidx.annotation.StringRes;

import com.hanlink.dsp.BtDspApplication;

public class YzToast {

    private static Toast mToast;
    public static void showShort(@StringRes int stringId){
        cancel();
        mToast = Toast.makeText(BtDspApplication.getInstance().getApplicationContext(),stringId, Toast.LENGTH_SHORT);
        mToast.show();
    }

    private static void cancel(){
        if (mToast != null)
            mToast.cancel();
        mToast = null;
    }

    public static void showShort(String text) {
        cancel();
        mToast = Toast.makeText(BtDspApplication.getInstance().getApplicationContext(),text, Toast.LENGTH_SHORT);
        mToast.show();
    }
}
